﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Text;

public partial class AdminCMS_tab_AD_Add : System.Web.UI.Page
{    
    int ADType = 0; //广告类型
    int IsActive = 0; //是否活动
        
    protected void Page_Load(object sender, EventArgs e)
    {
        UIMethod.GetQuery(ref ADType, "adtype");
        UIMethod.GetQuery(ref IsActive, "isactive");

        if (!IsPostBack)
        {
            adv_ZoneID.Items.AddRange(GlocalCache.GetAdZone_ListItems());

            adv_ADType.SelectedValue = ADType.ToString();
            adv_IsActive.SelectedIndex = IsActive;
        }
    }

    protected void btn_submit_Click(object sender, EventArgs e)
    {
        DataEntity.tab_Advertisement t = new DataEntity.tab_Advertisement();
        RequestQuery.SetEntityValues(t, form1);
        t.Insert();

        StringBuilder sb = new StringBuilder();
        sb.Append("?ADType=").Append(adv_ADType.SelectedValue).Append("&IsActive=").Append(adv_IsActive.SelectedIndex);
        UIMethod.Confirm("添加成功，继续添加吗？", "location = '" + Request.Path + sb.ToString() +
            "';", "location = 'tab_AD_List.aspx" + sb.ToString() + "';");
    }
}
